package com.amt.util;

import java.util.Random;

/**
 * @Title: MathUtil
 * @Package: com.amt.util
 * @Description: TODO
 * @Author: 杜强
 * @Date: 2019年10月24日 11:47
 * Copyright (c) ©1994-2019 Scjydz.com All Rights Reserved.
 **/
public class MathUtil {
    /**
     * @Description: 获取6-10 的随机位数数字
     * @param length	想要生成的长度
     * @return result
     */
    public static String getRandomNumber(Integer length) {
        String result = "";
        Random rand = new Random();
        int n = 20;
        if (null != length && length > 0) {
            n = length;
        }
        int randInt = 0;
        for (int i = 0; i < n; i++) {
            randInt = rand.nextInt(10);
            result += randInt;
        }
        return result;
    }
}
